package com.developmentReformProject.service.impl;

import com.developmentReformProject.dao.FiveProjectDao;
import com.developmentReformProject.dto.FiveQueryDto;
import com.developmentReformProject.dto.FiveYearProjectDto;
import com.developmentReformProject.entity.Enterprise;
import com.developmentReformProject.entity.FiveYearProject;
import com.developmentReformProject.entity.ThreeYearProject;
import com.developmentReformProject.service.FiveYearProjectLibraryService;
import com.developmentReformProject.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class FiveYearProjectLibraryServiceImpl implements FiveYearProjectLibraryService {
    @Autowired
    private FiveProjectDao fiveProjectDao;
    @Override
    public String addProject(FiveYearProject fiveYearProject) {
        return null;
    }

    @Override
    public String updateProject(FiveYearProject fiveYearProject) {
        return null;
    }

    @Override
    public String deleteProject(Integer projectNo) {
        return null;
    }

    @Override
    public String deleteProject(List[] projectNos) {
        return null;
    }

    @Override
    public FiveYearProjectDto queryProjectById(Integer projectNo) {
        return null;
    }

    @Override
    public List<FiveYearProjectDto> queryProjectList(List[] projectNo) {
        return null;
    }

    @Override
    public List<FiveYearProjectDto> queryProjectByConstructionStatus(String constructionStatus) {
        return null;
    }

    @Override
    public List<FiveYearProjectDto> queryProjectByentEnterpriseNumber(Enterprise enterprise) {
        return null;
    }

    @Override
    public List<FiveYearProjectDto> queryProjectByRevenue(Double revenue) {
        return null;
    }

    @Override
    public List<FiveYearProjectDto> queryProjectBySpecificType(String specificType) {
        return null;
    }

    @Override
    public String reportExport(Integer projectNo) {
        return null;
    }

    @Override
    public String overAllAnalysisOfTheFiveYearProject(FiveYearProjectDto fiveYearProjectDto) {
        return null;
    }

    @Override
    public PageUtil<FiveYearProject> pageList(FiveQueryDto fiveQueryDto) throws Exception {
        PageUtil<FiveYearProject> pageUtil=null;
        //统计满足条件记录总数
        int total=fiveProjectDao.countSelective(fiveQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<FiveYearProject> data=fiveProjectDao.selectSelective(fiveQueryDto);
            pageUtil=new PageUtil<>(total, data, fiveQueryDto.getCurrentPage(), fiveQueryDto.getPageSize());
        }
        return pageUtil;
    }

    @Override
    public PageUtil<FiveYearProject> cleanFive(FiveQueryDto fiveQueryDto) throws Exception {
        PageUtil<FiveYearProject> pageUtil=null;
        //统计满足条件记录总数
        int total=fiveProjectDao.countClean(fiveQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<FiveYearProject> data=fiveProjectDao.listDelete(fiveQueryDto);
            pageUtil=new PageUtil<>(total, data, fiveQueryDto.getCurrentPage(), fiveQueryDto.getPageSize());
        }
        return pageUtil;
    }
}
